import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "layout",
    redirect: "/home",
    component: () =>
      import(/* webpackChunkName: "layout" */ "@/views/layout/indexView.vue"),
    children: [
      {
        path: "/home",
        name: "home",
        component: () =>
          import(/* webpackChunkName: "home" */ "@/views/home/indexView.vue"),
      },
      {
        path: "/list/manage",
        name: "listManage",
        component: () =>
          import(
            /* webpackChunkName: "listManage" */ "@/views/listManage/indexView.vue"
          ),
      },
      {
        path: "/list/add",
        name: "listAdd",
        component: () =>
          import(
            /* webpackChunkName: "listAdd" */ "@/views/listAdd/indexView.vue"
          ),
      },
      {
        path: "/set",
        name: "set",
        component: () =>
          import(/* webpackChunkName: "set" */ "@/views/set/indexView.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
